package com.example.demo.controller.lxy;

import com.example.demo.service.lxy.RoleService;
import com.example.demo.entity.Role;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api("权限管理")
@RestController
public class RoleController {
    @Autowired
    RoleService roleService;
    @RequestMapping(value = "findall",method = RequestMethod.POST)
    @ApiOperation("管理员查询")
    public List<Role> finAll(){
        List<Role> roleList=roleService.findall();
        return roleList;
    }
    @RequestMapping(value = "findName",method = RequestMethod.POST)
    @ApiOperation("姓名查询")
    public List<Role> findByName(String name){
        List<Role> roleList= roleService.findByName(name);
        return roleList;
    }

}
